﻿using AutoMapper;
using ECommerce.Specs;
using ECommerce.Web.AutoMapper.ValueFormatters;
using Machine.Specifications;

namespace Currency_formatter_specs
{
    [Subject("Currency formatting")]
    public class When_displaying_a_currency_value
    {
        private static IValueFormatter currencyFormatter;

        Establish context = () =>
            {
                currencyFormatter = new CurrencyFormatter();
            };

        It should_format_decimal = () =>
            {
                decimal inputValue = 10.25m;
                string expectedOutput = inputValue.ToString("c");

                currencyFormatter.ShouldFormatValueAs(inputValue, expectedOutput);
            };
    }
}
